# name : hash: merge using set+retain
# key : hash_merge_set+retain
# contributor: Shuguang Sun
# --
data ${1:match};
  set ${2:small} (obs = 1); * this will work, too!;
  retain dsn 'small' x 10 kn 'key' dn 's_sat';

  dcl hash ${3:hh} (dataset: dsn, hashexp: x);
  $3.DefineKey( kn ); ** default to keep the first obs in the key, add();
  $3.DefineData( dn );
  $3.DefineDone();

  do until ( eof2 );
    set ${4:large} end = eof2;
    if $3.find() = 0 then output;
    end;
  stop;
run;